Elementry Counting Problems
Permutations (Definition)
The arrangement of different objects into a linear order using each object exactly once is called a permutation of these objects. The number of all permutations of objects is called factorial, and is denotes by .
Theorem 1
The number of all permutations of an n-element set is .
Theorem 2
Let be nonnegative integers satisfying . Consider a multiset of objects, in which objects are of type , for all . Then the number of ways to linearly order these objects is
Strings over a Finite Alphabet
Theorem
The number of -digit strings over an -element alphabet is .
Proof
We can choose the first digit in different ways. Then, we can choose the second digit in n different ways as well since we are allowed to use the same digit again (unlike in case of permutations). Similarly, we can choose the third, fourth, etc., kth element in n different ways. We can make all these choices independently from each other, so the total number of choices is .
Let and be two finite sets, and let be a function so that
- if , then , and
- for all there is an so that ,
then we say that is a bijection from onto . Equivalently, is a bijection if for all , there exists a unique so that . In other words, a bijection matches the elements of with the elements of , so that each element will have exactly one match.
The functions that have only one of the two defining properties of bijections also have their own names.
Let be a function. If satisfies criterion (1) of the bijection definition, then we say that is one-to-one or injective, or is an injection. If satisfies criterion (2), then we say that is onto or surjective, or is a surjection.
Proposition
Let and be two finite sets. If there exists a bijection from onto , then and have the same number of elements.
Proof
The bijection matches elements of to elements of , in other words it creates pairs with one element from and one from in each pair. If created pairs, then both and have elements.
Theorem
Let and be positive integers satisfying . Then the number of -digit strings over an n-element alphabet in which no letter is used more than once is
Proof
Indeed, we have choices for the first digit, choices for the second digit, and so on, just as we did in the case of factorials. The only difference is that here we do not necessarily use all our objects, we stop after choosing of them.
Choice Problems (Definition)
The number of -element subsets of is denoted and is read " choose ".
The numbers are often called binomial coefficients.
Theorem
For all nonnegative integers , the equality
holds.
Proof
To select a -element subset of [n], we first select a -element string in which the digits are elements of . By Theorem 3.6, we can do that in different ways. However, in these strings the order of the elements does matter. In fact, each -element subset occurs ! times among these strings as its elements can be permuted in ! different ways. Therefore, the number of -element subsets is ! times the number of -element strings, and the proof follows.
Let . Then the complement of , denoted is the subset of that consists precisely of the elements that are not in . In other words, is the unique subset of that for all satisfies the following statement: if and only if .
The following proposition summarizes some straightforward properties of the numbers . We choose to announce these easy statements as a proposition since they will be used incessantly in the coming sections.
Proposition
For all nonnegative integers , the following hold.
Proof
- We set up a bijection from the set of all -element subsets of onto that of all -element subsets of . This will be simplicity itself: it will map any given -element subset into its complement . Then for any -element subset , there is exactly one so that , namely . So is indeed a bijection, proving that the number of -element subsets of is the same as that of -element subsets of , which, by definition, means that .
- The first equality is a special case of the claim of part 1 , with . To see that , note that the only 0 -element subset of is the empty set.